<template>
	<view class="regist-main">
		
		<view class="regist-top">
			<view class="regist-top-item" :class="{'regist-top-active':hid==item.id}" @click="goToTap" :data-id="item.id" v-for="(item,index) in houseArr">{{item.name}}</view>
		</view>
		<view class="regist-buyHouse" v-if="hid==1">
			
			<uni-forms ref="form1" :modelValue="current" :rules="rules" validate-trigger="bind" err-show-type="undertext">
				<view class="page-foot bg-white">
					<view class="foot-wrap flex-box flex-between m-hairline--top">
						<view class="foot-btn2" @click="BuySubmit()">提交</view>
					</view>
				</view>
				<view class="container">
					
					<view class="plr30">
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 m-hairline--bottom">
									<view class="fs30 col89 marbtm">销售代表</view>
									<input type="text" v-model="current.sales_representative" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<picker mode="date" :value="decorationDate" @change="decorationDatePicker">
							<view class="pb30 m-hairline--bottom">
								<uni-forms-item name="fixturestime">
									<input v-model="fixturestime" type="text" hidden></input>
									<view class="fs30 col89 marbtm">接访日期</view>
									<view class="m-arrow-right fs30 col3">
										{{fixturestime.length > 0 ? fixturestime : '请选择'}}
									</view>
								</uni-forms-item>
							</view>
						</picker>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">客户姓名</view>
									<input type="text" v-model="current.name" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">性别</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sexArr">
									<view class="label" @click="checkSexType(index)" :class="index==sexIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">联系方式</view>
									<input type="tel" v-model="current.contact" class="heading" maxlength="11" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">客户需求面积(㎡)</view>
									<input type="digit" v-model="current.required_area" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">位置</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in posiArr">
									<view class="label" @click="checkPosiType(index)" :class="index==posiIndex?'active':''">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">带看小区</view>
									<input type="text" v-model="current.look_at_the_community" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">建筑风格</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in styleArr">
									<view class="label" @click="checkStyleType(index)" :class="index==styleIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">建筑形式</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in bulidTypeArr">
									<view class="label" @click="checkBulidType(index)" :class="index==bulidTypeIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">园林</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in parkArr">
									<view class="label" @click="checkParkType(index)" :class="index==parkIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">车库/位需求量</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in carParkArr">
									<view class="label" @click="checkCarParkType(index)" :class="index==carParkIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">价格意愿</view>
									<input type="text" v-model="current.price_willingness" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">置业周期</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in cycleArr">
									<view class="label" @click="checkCycleType(index)" :class="index==cycleIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">付款方式</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in payArr">
									<view class="label" @click="checkPayType(index)" :class="index==payIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">名下房产(套)</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in myhouseArr">
									<view class="label" @click="checkMyhouseType(index)" :class="index==myhouseIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">到访途径</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in visitArr">
									<view class="label" @click="checkVisitType(index)" :class="index==visitIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">约访次数</view>
									<input type="text" v-model="current.make_num" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">购房需求</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in buyHouseArr">
									<view class="label" @click="checkBuyHouseType(index)" :class="index==buyHouseIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">纠结原因</view>
									<input type="text" v-model="current.entangled_reasons" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">沟通状态</view>
									<input type="text" v-model="current.watch_status" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
					</view>
				</view>
			</uni-forms>
		</view>
		<!-- 二手房房 卖房客户信息 -->
		<view class="regist-sellHouse" v-if="hid==2">
			
			<uni-forms ref="form2" :modelValue="current" :rules="rules" validate-trigger="bind" err-show-type="undertext">
				<view class="page-foot bg-white">
					<view class="foot-wrap flex-box flex-between m-hairline--top">
						<view class="foot-btn2" @click="SellSubmit()">提交</view>
					</view>
				</view>
				<view class="container">
					
					<view class="plr30">
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 m-hairline--bottom">
									<view class="fs30 col89 marbtm">销售代表</view>
									<input type="text" v-model="present.sales_representative" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<picker mode="date" :value="decorationDate" @change="sellDecorationDatePicker">
							<view class="pb30 m-hairline--bottom">
								<uni-forms-item name="fixturestime">
									<input v-model="sellfixturestime" type="text" hidden></input>
									<view class="fs30 col89 marbtm">接访日期</view>
									<view class="m-arrow-right fs30 col3">
										{{sellfixturestime.length > 0 ? sellfixturestime : '请选择'}}
									</view>
								</uni-forms-item>
							</view>
						</picker>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">客户姓名</view>
									<input type="text" v-model="present.name" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">性别</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellsexArr">
									<view class="label" @click="sellCheckSexType(index)" :class="index==sellsexIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">联系方式</view>
									<input type="tel" v-model="present.contact" maxlength="11" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<!-- <view>卖房客户信息</view> -->
						
						<picker mode="date" :value="decorationDate" @change="sellCollectionDatePicker">
							<view class="pb30 m-hairline--bottom">
								<uni-forms-item name="fixturestime">
									<input v-model="sellcollection_shijian" type="text" hidden></input>
									<view class="fs30 col89 marbtm">收房时间</view>
									<view class="m-arrow-right fs30 col3">
										{{sellcollection_shijian.length > 0 ? sellcollection_shijian : '请选择'}}
									</view>
								</uni-forms-item>
							</view>
						</picker>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">面积</view>
									<input type="text" v-model="present.house_area" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">户型</view>
									<input type="text" v-model="present.house_type" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">装修标准</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellZhxiuArr">
									<view class="label" @click="sellcheckZhxiuType(index)" :class="index==sellzhxiuIndex?'active':''">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">抵押状况</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in selldiyaArr">
									<view class="label" @click="sellcheckDiyaType(index)" :class="index==selldiyaIndex?'active':''">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">居住状态</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellJuzhuArr">
									<view class="label" @click="sellcheckJuzhuType(index)" :class="index==selljuzhuIndex?'active':''">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">卖房周期</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellZhqiArr">
									<view class="label" @click="sellcheckZhqiType(index)" :class="index==sellzhqiIndex?'active':''">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">办证时间</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellBanzhArr">
									<view class="label" @click="sellcheckBanzhType(index)" :class="index==sellbanzhIndex?'active':''">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">付款方式</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellPayArr">
									<view class="label" @click="sellcheckPayType(index)" :class="index==sellpayIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						
						<view class="pb30">
							<view class="fs30 col89 marbtm">名下房产套数</view>
							<view class="label-list flex-box flex-wrap">
								<block v-for="(item,index) in sellMyhouseArr">
									<view class="label" @click="sellCheckMyhouseType(index)" :class="index==sellmyhouseIndex?'active':''" style="padding: 0 20rpx;width: unset;">
										{{item.name}}
										<image class="icon-select" src="/static/icon/icon_gou.png" mode="aspectFit"></image>
									</view>
								</block>
							</view>
						</view>
						
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">出售价格</view>
									<input type="text" v-model="present.price" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
						<view class="pb30">
							<uni-forms-item name="name">
								<view class="pt50 pb30 m-hairline--bottom">
									<view class="fs30 col89 marbtm">沟通状态</view>
									<input type="text" v-model="present.watch_status" class="heading" placeholder="请填写" />
								</view>
							</uni-forms-item>
						</view>
						
					</view>
				
				</view>
			</uni-forms>
		</view>
	</view>
</template>

<script>
	const core = require('@/xilu/core.js');
	export default {
		data() {
			return {
				houseArr:[
					{
						id:1,
						name:'买房登记表',
					},
					{
						id:2,
						name:'卖房登记表',
					},
				],
				hid:1,//买房登记表 1，卖房登记表 2
				//买房登记表 信息开始
				current:{
					sales_representative:'',//销售代表
					date_of_visit:'',//接访日期
					name:'',//客户姓名
					sex_data:1,//性别(单选):1=男,2=女
					contact:'',//联系方式
					required_area:'',// 客户需求面积(㎡)
					position_data:1,//位置(单选):1=新区,2=老区,3=新区老区交界
					look_at_the_community:'',//带看小区
					architectural_style_data:1,//建筑风格(单选):1=喜欢,2=一般,3=不喜欢
					architectural_form_data:1,//建筑形式(单选):1=高层,2=多层,3=别墅
					gardens_data:1,//园林(单选):1=喜欢,2=一般,3=不喜欢
					garage_num_data:1,//车库/位需求量(单选):1=车库,2=车位
					price_willingness:'',//价格意愿
					real_estate_cycle_data:1,//置业周期(单选):1=着急,2=3个月内,3=半年内,4=一年内
					pay_method_data:1,//付款方式(单选):1=公积金贷款,2=按揭贷款,3=一次性付款,
					number_of_properties:1,//1=无,2=一套,3=两套,4=多套
					visiting_route_data:1,//到访途径(单选):1=路过,2=服务号,3=推荐,4=约访,5=围挡,6=广场大屏,7=电影院广告,8=出租车,9=联通大屏,10=锡林123,11=锡盟事
					make_num:'',//约访次数
					purchase_demand_data:1,//购房需求(单选):1=结婚,2=改善,3=学区,4=投资,5=其他
					entangled_reasons:'',//纠结原因
					watch_status:'',//沟通状态
				},
				
				
				sexArr:[
					{
						id:1,
						name:'男'
					},
					{
						id:2,
						name:'女'
					},
				],
				sexIndex:0,
				sexid:1,
				
				//位置
				posiArr:[
					{
						id:1,
						name:'新区',
					},
					{
						id:2,
						name:'老区',
					},
					{
						id:3,
						name:'新区老区交界',
					},
				],
				posiIndex:0,
				posiid:1,
				//接访日期
				fixturestime: '',
				// 建筑风格
				styleArr:[
					{
						id:1,
						name:'喜欢'
					},
					{
						id:2,
						name:'一般'
					},
					{
						id:3,
						name:'不喜欢'
					},
				],
				styleIndex:0,
				styleid:1,
				// 建筑形式
				bulidTypeArr:[
					{
						id:1,
						name:'高层'
					},
					{
						id:2,
						name:'多层'
					},
					{
						id:3,
						name:'别墅'
					},
				],
				bulidTypeIndex:0,
				bulidTypeid:1,
				// 园林
				parkArr:[
					{
						id:1,
						name:'喜欢'
					},
					{
						id:2,
						name:'一般'
					},
					{
						id:3,
						name:'不喜欢'
					},
				],
				parkIndex:0,
				parkid:1,
				// 车库\位
				carParkArr:[
					{
						id:1,
						name:'车库'
					},
					{
						id:2,
						name:'车位'
					},
				],
				carParkIndex:0,
				carParkid:1,
				//置业周期
				cycleArr:[
					{
						id:1,
						name:'着急'
					},
					{
						id:2,
						name:'3个月内'
					},
					{
						id:3,
						name:'半年内'
					},
					{
						id:4,
						name:'一年内'
					},
				],
				cycleIndex:0,
				cycleid:1,
				//付款方式
				payArr:[
					{
						id:1,
						name:'公积金贷款'
					},
					{
						id:2,
						name:'按揭贷款'
					},
					{
						id:3,
						name:'一次性付款'
					},
				],
				payIndex:0,
				payid:1,
				
				//名下房产套数
				myhouseArr:[
					{
						id:1,
						name:'无'
					},
					{
						id:2,
						name:'一套'
					},
					{
						id:3,
						name:'两套'
					},
					{
						id:4,
						name:'多套'
					},
				],
				myhouseIndex:0,
				myhouseid:1,
				
				visitArr:[
					{
						id:1,
						name:'路过'
					},
					{
						id:2,
						name:'服务号'
					},
					{
						id:3,
						name:'推荐'
					},
					{
						id:4,
						name:'约访'
					},
					{
						id:5,
						name:'围挡'
					},
					{
						id:6,
						name:'广场大屏'
					},
					{
						id:7,
						name:'电影院广告'
					},
					{
						id:8,
						name:'出租车'
					},
					{
						id:9,
						name:'联通大屏'
					},
					{
						id:10,
						name:'锡林123'
					},
					{
						id:11,
						name:'锡盟事'
					},
				],
				visitIndex:0,
				visitid:1,
				//购房需求
				buyHouseArr:[
					{
						id:1,
						name:'结婚'
					},
					{
						id:2,
						name:'改善'
					},
					{
						id:3,
						name:'学区'
					},
					{
						id:4,
						name:'投资'
					},
					{
						id:5,
						name:'其他'
					},
				],
				buyHouseIndex:0,
				buyHouseid:1,
				
				//买房登记表 信息结束
				
				// ------------------------------------------------------

				//卖房登记表 信息开始
				
				present:{
					sales_representative:'',//销售代表
					date_of_visit:'',//接访日期
					name:'',//客户姓名
					sex_data:1,//性别(单选):1=男,2=女
					contact:'',//联系方式
					collection_shijian:'',// 收房时间
					house_area:'',//面积(㎡)
					house_type:'',//户型
					decoration_standards_data:1,//装修标准(单选):1=精装,2=中装,3=简装,4=毛坯
					mortgage_status_data:1,//抵押状况(单选):1=未抵押,2=公积金贷,3=银行,4=其他
					residential_status_data:1,//居住状态(单选):1=自主,2=出租,3=空置
					sales_cycle_data:1,//卖房周期(单选):1=着急,2=3个月内,3=半年内,4=一年内
					certificate_processing_time_data:1,//办证时间(单选):1=协议,2=新本,3=满二年,4=满五年
					pay_method_data:1,//付款方式(单选):1=公积金贷款,2=按揭贷款,3=一次性付款,
					price:'',//出售价格
					watch_status:'',//沟通状态
				},
				
				//接访日期
				sellfixturestime: '',
				//性别
				sellsexArr:[
					{
						id:1,
						name:'男'
					},
					{
						id:2,
						name:'女'
					},
				],
				sellsexIndex:0,
				sellsexid:1,
				sellcollection_shijian:'',
				//装修标准
				sellZhxiuArr:[
					{
						id:1,
						name:'精装',
					},
					{
						id:2,
						name:'中装',
					},
					{
						id:3,
						name:'简装',
					},
					{
						id:4,
						name:'毛坯',
					},
				],
				sellzhxiuIndex:0,
				sellzhxiuid:1,
				//抵押状况
				selldiyaArr:[
					{
						id:1,
						name:'未抵押',
					},
					{
						id:2,
						name:'公积金贷',
					},
					{
						id:3,
						name:'银行',
					},
					{
						id:4,
						name:'其他',
					},
				],
				selldiyaIndex:0,
				selldiyaid:1,
				//居住状态
				sellJuzhuArr:[
					{
						id:1,
						name:'自住',
					},
					{
						id:2,
						name:'出租',
					},
					{
						id:3,
						name:'空置',
					},
				],
				selljuzhuIndex:0,
				selljuzhuid:1,
				
				//卖房周期
				sellZhqiArr:[
					{
						id:1,
						name:'着急',
					},
					{
						id:2,
						name:'三个月内',
					},
					{
						id:3,
						name:'半年内',
					},
				],
				sellzhqiIndex:0,
				sellzhqiid:1,
				//办证时间
				sellBanzhArr:[
					{
						id:1,
						name:'协议',
					},
					{
						id:2,
						name:'新本',
					},
					{
						id:3,
						name:'满二年',
					},
					{
						id:4,
						name:'满五年',
					},
				],
				sellbanzhIndex:0,
				sellbanzhid:1,
				
				//付款方式
				sellPayArr:[
					{
						id:1,
						name:'公积金贷款'
					},
					{
						id:2,
						name:'按揭贷款'
					},
					{
						id:3,
						name:'一次性付款'
					},
				],
				sellpayIndex:0,
				sellpayid:1,
				
				//名下房产套数
				sellMyhouseArr:[
					{
						id:1,
						name:'无'
					},
					{
						id:2,
						name:'一套'
					},
					{
						id:3,
						name:'两套'
					},
					{
						id:4,
						name:'多套'
					},
				],
				sellmyhouseIndex:0,
				sellmyhouseid:1,
				
				//卖房登记表 信息结束
				
			}
		},
		onReady: function() {
			// this.$refs.form1.setRules(this.rules)
			// this.$refs.form2.setRules(this.rules)
		},
		onLoad(options) {
			let that = this;
			
		},
		
		methods: {
			// 性别
			checkSexType(index) {
				this.sexIndex = index;
				this.sexid = this.sexArr[index].id;
				this.current.sex_data = this.sexArr[index].id;
			},
			//位置
			checkPosiType(index){
				this.posiIndex = index;
				this.posiid = this.posiArr[index].id;
				this.current.position_data = this.posiArr[index].id;
			},
			//接访日期
			decorationDatePicker(e) {
				this.fixturestime = e.detail.value;
				this.current.date_of_visit = e.detail.value;
			},
			//建筑风格
			checkStyleType(index){
				this.styleIndex = index;
				this.styleid = this.styleArr[index].id;
				this.current.architectural_style_data= this.styleArr[index].id;
			},
			//建筑形式
			checkBulidType(index){
				this.bulidTypeIndex = index;
				this.bulidTypeid = this.bulidTypeArr[index].id
				this.current.architectural_form_data= this.bulidTypeArr[index].id;
			},
			//园林
			checkParkType(index){
				this.parkIndex = index;
				this.parkid = this.parkArr[index].id;
				this.current.gardens_data= this.bulidTypeArr[index].id;
			},
			//车库/位需求量
			checkCarParkType(index){
				this.carParkIndex = index;
				this.carParkid = this.carParkArr[index].id;
				this.current.garage_num_data= this.carParkArr[index].id;
			},
			//置业周期
			checkCycleType(index){
				this.cycleIndex = index;
				this.cycleid = this.cycleArr[index].id;
				this.current.real_estate_cycle_data= this.cycleArr[index].id;
			},
			// 付款方式
			checkPayType(index){
				this.payIndex = index;
				this.payid = this.payArr[index].id;
				this.current.pay_method_data= this.payArr[index].id;
			},
			//名下房产套数
			checkMyhouseType(index){
				this.myhouseIndex = index;
				this.myhouseid = this.myhouseArr[index].id;
				this.current.number_of_properties= this.myhouseArr[index].id;
			},
			//到访途径
			checkVisitType(index){
				this.visitIndex = index;
				this.visitid = this.visitArr[index].id;
				this.current.visiting_route_data= this.visitArr[index].id;
			},
			//购房需求
			checkBuyHouseType(index){
				this.buyHouseIndex = index;
				this.buyHouseid = this.buyHouseArr[index].id;
				this.current.purchase_demand_data= this.buyHouseArr[index].id;
			},
			
			
			goToTap(e){
				let that = this;
				this.hid = e.currentTarget.dataset.id;
				console.log(this.hid);
			},

			BuySubmit() {
				let that = this;
				that.$refs.form1.validate(valid => {
					if (!valid) {
						let form = that.current;
						if (!form.sales_representative) {
							uni.showToast({title: '请填写销售代表',icon: "none"})
							return false;
						}
						if (!form.date_of_visit) {
							uni.showToast({title: '请选择接访日期',icon: "none"})
							return false;
						}
						if (!form.name) {
							uni.showToast({title: '请填写客户姓名',icon: "none"})
							return false;
						}
						
						if (!form.contact) {
							uni.showToast({title: '请填写联系方式',icon: "none"})
							return false;
						}
						if (!form.required_area) {
							uni.showToast({title: '请填写客户需求面积(㎡)',icon: "none"})
							return false;
						}
						
						if (!form.look_at_the_community) {
							uni.showToast({title: '请填写带看小区',icon: "none"})
							return false;
						}
						
						if (!form.price_willingness) {
							uni.showToast({title: '请填写价格意愿',icon: "none"})
							return false;
						}
						
						if (!form.make_num) {
							uni.showToast({title: '请填写约访次数',icon: "none"})
							return false;
						}
						
						if (!form.entangled_reasons) {
							uni.showToast({title: '请填写纠结原因',icon: "none"})
							return false;
						}
						if (!form.watch_status) {
							uni.showToast({title: '请填写沟通状态',icon: "none"})
							return false;
						}
						
						console.log(form);
						core.post({
							url: 'api/broker/buyhouse/post',
							data: form,
							loading:true,
							success: ret => {
								console.log(ret);
								uni.showToast({
									title: ret.msg,
									icon: 'none',
									success:function (){
										uni.$emit("refreshRental",{})
										uni.navigateBack({
											delta: 1
										})
									}
								});
							}
						});
					} else {
						console.log('验证失败');
					}
				});
			},


			//卖房 登记表

			//接访日期
			sellDecorationDatePicker(e) {
				this.sellfixturestime = e.detail.value;
				this.present.date_of_visit = e.detail.value;
			},
			// 性别
			sellCheckSexType(index) {
				this.sellsexIndex = index;
				this.sellsexid = this.sellsexArr[index].id;
				this.present.sex_data = this.sellsexArr[index].id;
			},
			//接访日期
			sellCollectionDatePicker(e) {
				this.sellcollection_shijian = e.detail.value;
				this.present.collection_shijian = e.detail.value;
			},
			//装修标准
			sellcheckZhxiuType(index){
				this.sellzhxiuIndex = index;
				this.sellzhxiuid = this.sellZhxiuArr[index].id;
				this.present.decoration_standards_data = this.sellZhxiuArr[index].id;
			},
			//抵押状况
			sellcheckDiyaType(index){
				this.selldiyaIndex = index;
				this.selldiyaid = this.selldiyaArr[index].id;
				this.present.mortgage_status_data = this.selldiyaArr[index].id;
			},
			//居住状态
			sellcheckJuzhuType(index){
				this.selljuzhuIndex = index;
				this.selljuzhuid = this.sellJuzhuArr[index].id;
				this.present.residential_status_data = this.sellJuzhuArr[index].id;
			},
			//卖房周期
			sellcheckZhqiType(index){
				this.sellzhqiIndex = index;
				this.sellzhqiid = this.sellZhqiArr[index].id;
				this.present.sales_cycle_data = this.sellZhqiArr[index].id;
			},
			//办证时间
			sellcheckBanzhType(index){
				this.sellbanzhIndex = index;
				this.sellbanzhid = this.sellBanzhArr[index].id;
				this.present.certificate_processing_time_data = this.sellBanzhArr[index].id;
			},
			// 付款方式
			sellcheckPayType(index){
				this.sellpayIndex = index;
				this.sellpayid = this.sellPayArr[index].id;
				this.present.pay_method_data = this.sellPayArr[index].id;
			},
			
			//名下房产套数checkMyhouseType
			sellCheckMyhouseType(index){
				this.sellmyhouseIndex = index;
				this.sellmyhouseid = this.sellMyhouseArr[index].id;
				this.present.number_of_properties= this.sellMyhouseArr[index].id;
			},

			SellSubmit() {
				let that = this;
				that.$refs.form2.validate(valid => {
					if (!valid) {
						let form = that.present;
						if (!form.sales_representative) {
							uni.showToast({title: '请填写销售代表',icon: "none"})
							return false;
						}
						if (!form.date_of_visit) {
							uni.showToast({title: '请选择接访日期',icon: "none"})
							return false;
						}
						if (!form.name) {
							uni.showToast({title: '请填写客户姓名',icon: "none"})
							return false;
						}
						
						if (!form.contact) {
							uni.showToast({title: '请填写联系方式',icon: "none"})
							return false;
						}
						if (!form.collection_shijian) {
							uni.showToast({title: '请填写收房时间',icon: "none"})
							return false;
						}
						if (!form.house_area) {
							uni.showToast({title: '请填写面积(㎡)',icon: "none"})
							return false;
						}
						if (!form.house_type) {
							uni.showToast({title: '请填写户型',icon: "none"})
							return false;
						}
						
						if (!form.price) {
							uni.showToast({title: '请填写出售价格',icon: "none"})
							return false;
						}
						if (!form.watch_status) {
							uni.showToast({title: '请填写沟通状态',icon: "none"})
							return false;
						}
						
						console.log(form);
						core.post({
							url: 'api/broker/sellershouse/post',
							data: form,
							loading:true,
							success: ret => {
								console.log(ret);
								uni.showToast({
									title: ret.msg,
									icon: 'none',
									success:function (){
										uni.$emit("refreshRental",{})
										uni.navigateBack({
											delta: 1
										})
									}
								});
							}
						});
					} else {
						console.log('验证失败');
					}
				});
			},

			
			
			
		},
		
	}
</script>

<style scoped lang="less">
	
	.regist-main{
		width:100%;
		height:auto;
		overflow:hidden;
		padding-top:100rpx;
		box-sizing:border-box;
	}
	
	.regist-top{
		width:100%;
		height:auto;
		overflow:hidden;
		background:#fff;
		position:fixed;
		top:0;
		left:0;
		z-index:99;
		box-sizing:border-box;
		border-bottom:1px solid #efefef;
	}
	.regist-top-item{
		width:50%;
		height:auto;
		line-height:50rpx;
		font-size:30rpx;
		color:#999;
		text-align:center;
		overflow:hidden;
		background:#fff;
		float:left;
		padding:20rpx;
	}
	.regist-top-active{
		color:#000;
		font-weight:bold;
	}
	
	.icon-search {
		padding: 5rpx;
		display: block;
		width: 40rpx;
		height: 40rpx;
	}


	.upload .item {
		position: relative;
		margin: 0 30rpx 30rpx 0;
		width: 200rpx;
		height: 156rpx;
		border-radius: 10rpx;
		overflow: hidden;
	}

	.upload .item:nth-of-type(3n) {
		margin: 0 0 30rpx;
	}

	.upload .item.btn {
		padding: 36rpx 0 0;
		background: #F7F9FC;
	}

	.upload .icon {
		margin: 0 auto 7rpx;
		display: block;
		width: 45rpx;
		height: 45rpx;
	}

	.upload .img {
		display: block;
		width: 200rpx;
		height: 156rpx;
	}

	.upload .icon-clear {
		position: absolute;
		right: 13rpx;
		top: 13rpx;
		display: block;
		width: 30rpx;
		height: 30rpx;
		z-index: 10;
	}


	.upload-box {
		position: relative;
		width: 750rpx;
		height: 500rpx;
		background: #F7F9FC;

		.icon-upload {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			display: block;
			width: 183rpx;
			height: 140rpx;
			z-index: 1;
		}

		.img {
			position: absolute;
			top: 0;
			left: 0;
			display: block;
			width: 750rpx;
			height: 500rpx;
			z-index: 2;
		}
	}

	.heading {
		width: 690rpx;
		height: 88rpx;
		font-size: 30rpx;
		font-weight: 500;
		color: #101010;
		line-height: 44rpx;
	}

	.label-list {
		.label {
			position: relative;
			margin: 0 20rpx 20rpx 0;
			
			min-width: 70rpx;
			height: 66rpx;
			background: #F8F9FB;
			border-radius: 4rpx;
			border: 1px solid #EEEEEE;
			font-size: 26rpx;
			color: #333333;
			line-height: 66rpx;
			text-align: center;
			box-sizing:border-box;
			padding:0 10rpx;

			.icon-select {
				position: absolute;
				right: 0;
				bottom: -1rpx;
				display: none;
				width: 31rpx;
				height: 28rpx;
			}
		}

		// .label:nth-of-type(4n) {
		// 	margin: 0 0 20rpx;
		// }

		.label.active {
			color: var(--normal);
			border: 1px solid var(--normal);

			.icon-select {
				display: block;
			}
		}
	}

	.page-foot {
		.foot-wrap {
			padding: 10rpx 60rpx;

			.foot-btn1 {
				width: 300rpx;
				height: 80rpx;
				border-radius: 40rpx;
				border: 1px solid var(--normal);
				font-size: 30rpx;
				color: var(--normal);
				line-height: 80rpx;
				text-align: center;
			}

			.foot-btn2 {
				width: 100%;
				height: 80rpx;
				border-radius: 40rpx;
				background: var(--normal);
				font-size: 30rpx;
				color: #FFFFFF;
				line-height: 80rpx;
				text-align: center;
			}
		}
	}
	.pt50{
		padding-top:30rpx;
	}
	.pb30{
		padding-bottom:15rpx;
		width:100%;
	}
	.marbtm{
		margin-bottom:15rpx;
	}
</style>
